<script>
	$(function(){
		var numberTemplate = {formatter: 'number', align: 'right', sorttype: 'number'};	 
		$("#tblData").jqGrid({
			url:'index.php?r=akSiswa_PNK/listClassHist',
			postData:{"student_id":<?php echo $student_id ?>},
			datatype: 'json',
			loadonce:true,
			mtype:"GET",
			autowidth:true,
			height:"100%",
			width:"100%",
			altRows:true,
			ignoreCase:true,
			//$strFields="id,department_id,sid,name,if(gender='P','Pria','Wanita') as gender,birth_date,address,home_phone,handphone,email,ayah_nama,ibu_nama,wali_nama,is_active";
			colNames: ['id','student ID','Tahun Ajaran','Tingkatan','Kelas'],
			colModel: [
				{name: 'id', index: 'id', width: 20,hidden:true,sorttype:'int',formatter:'int'},
				{name: 'student_id', index: 'student_id', width: 20,hidden:true,sorttype:'int',formatter:'int'},
				{name: 'tahun_ajaran_name', index: 'tahun_ajaran_name', width: 100,search:true},
				{name: 'tingkatan_name', index: 'tingkatan_name', width: 100,search:true},
				{name: 'kelas_name', index: 'kelas_name', width: 100,search:true},
			],
			gridview: true,
			rownumbers: false,
			rowNum: 10,
			rowList: [5, 10, 15],
			pager: '#navTblData',
			viewrecords: true,
			caption: '<?php echo Yii::t("label", "Riwayat Kelas"); ?>',
			jsonReader : { 
				root:"model",
				repeatitems: false			
			},
			loadComplete:function(data){
				console.log(data);
			},
		});
		$("#tblData").jqGrid('navGrid','#navTblData',{add:false,edit:false,search:false,del:false,refresh:false});		
		//refreshGrid();

				
	});
</script>

<div style="width:500px;margin-left:auto;margin-right:auto">
	<table id="tblData"><tr></tr></table>
	<div id="navTblData"></div>
</div>